package com.whh.nlp.controller;

import com.whh.nlp.service.DapeiService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

@Controller
public class DapeiController {

    @Autowired
    DapeiService dapeiService;

    @RequestMapping("/dapei")
    public String daPei(@RequestParam(value = "str", defaultValue = "开心") String str,
                        @RequestParam(value = "pageNum", defaultValue = "1")Integer pageNum,
                        Model model) {
        model.addAttribute("recordPageInfo", dapeiService.getDapei(pageNum, str));
        model.addAttribute("str", str);
        model.addAttribute("dapeiCountList", dapeiService.getDapeiCountList());
        return "/dapei/dapei.html";
    }


}
